<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>系统配置</title>
        <base href="<?php echo base_url(); ?>"/>
        <link href="<?php echo base_url(); ?>content/style.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url(); ?>content/kandytabs/kandytabs.css" rel="stylesheet" type="text/css" />
        <script src="<?php echo base_url(); ?>script/external/jquery-1.8.3.min.js" type="text/javascript"></script>
        <script src="<?php echo base_url(); ?>script/kandytabs/kandytabs.pack.js" type="text/javascript"></script>
        <script src="<?php echo base_url(); ?>script/lodopPrint/LodopFuncs.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function(){
                $("#verifystep").KandyTabs({
                    trigger:"step",
                    classes:"kandyStep",
                    nav:true,
                    lang:{first:["",""],prev:["上一步","上一步"],next:["下一步","下一步"],last:["",""]},
                    custom:function(b,c,i,t){
                        i == 0 ? $(".tabprev",t).hide() : $(".tabprev",t).show()
                        i == b.length-1 ? $(".tabnext",t).hide() : $(".tabnext",t).show()
                        b.eq(i).removeClass("tabok").prev().addClass("tabok").next().removeClass("tabok")
                        c.eq(i).find("input").keyup(function(){
                            if (this.value != "") {
                                $(".tabnext",t).removeClass("tabnextno")
                                $(this).removeClass("err")
                            } else {
                                $(".tabnext",t).addClass("tabnextno")
                                $(this).addClass("err")
                            }
                        })
                        setTimeout(function(){c.eq(i).find("input").trigger("keyup")},1)
                        if (i==3) {
                            var systemName= $("#systemName").val();
                            var userName=$("#userName").val();
                            var u_userName=$("#uuserName").val();
                            var password=$("#password").val();
                            $.post("<?php echo site_url(); ?>/system/C_System/ajax_insert/", {Action:"post",systemName:systemName,userName:userName,password:password,uuserName:u_userName}, 
                            function (data){
                                if (data>0) {
                                    window.location.href="<?php echo site_url(); ?>/C_Login";
                                }
                            })
                        }
                    },
                    done:function(b,c,t){
                        $("input",t).each(function(){
                            this.value == "" ?  $(this).addClass("err") : $(this).removeClass("err")
                        })
                        b.first().trigger("step")
                    }
                });
            })    
        </script>
    </head>
    <body>
        <div class="header">
            <div class="header03"></div>
            <div class="header01"></div>
            <div class="header02"></div>
        </div>
        <div class="right01">系统初始化</div>
        <div id="content">
            <div id="verifystep" style="margin: 15px 100px 15px 100px;">
                <h4>第一步：安装打印插件</h4>
                <div>
                    <ul>
                        <li><span style="font-weight:bold;"><a href="javascript:void(0)" onclick="CheckIsInstall()">检测打印控件</a></span></li>
                        <li><span  id="alertShow"></span></li>
                    </ul>
                </div>

                <h4>第二步：系统名称</h4>
                <div>
                    <ul>
                        <li><span style="font-weight:bold;">设置系统的名称</span></li>
                        <li>系统名称：&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="systemName" style="width: 15em"/></li>
                    </ul>
                </div>
                <h4>第三步：创建管理员</h4>
                <div>
                    <ul>
                        <li><span style="font-weight:bold;">创建管理员</span></li>
                        <li>用户姓名：&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="uuserName" style="width: 15em" /></li>
                        <li>登陆名称：&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="userName" style="width: 15em" /></li>
                        <li>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：&nbsp;&nbsp;&nbsp;&nbsp;<input type="password" id="password" style="width: 15em"/></li>
                    </ul>
                </div>
                <h4>第四步：完成</h4>
                <div style="height: 300px">
                    <ul>
                        <li>信息正在提交，请稍候...</li>
                        <li>进入登陆页面倒计时：<span id="time" style="color: #4a8cf6"></span></li>
                    </ul>
                </div>
            </div>
        </div>
        <div style="display: none">
            <object  id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> 
                <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
            </object>
        </div>
    </body>
</html>
<script type="text/javascript">
    function CheckIsInstall() {	
        try{
            var LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
            if ((LODOP!=null)&&(typeof(LODOP.VERSION)!="undefined")) $("#alertShow").text("本机已成功安装过Lodop控件!\n  版本号:"+LODOP.VERSION);
        }catch(err){
            //alert("Error:本机未安装或需要升级!");
        }
    }
</script>